package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.YaClassMapper;
import com.ruoyi.teaching.domain.YaClass;
import com.ruoyi.teaching.service.IYaClassService;

/**
 * 班级Service业务层处理
 * 
 * @author ZBX
 * @date 2025-03-10
 */
@Service
public class YaClassServiceImpl implements IYaClassService 
{
    @Autowired
    private YaClassMapper yaClassMapper;

    /**
     * 查询班级
     * 
     * @param id 班级主键
     * @return 班级
     */
    @Override
    public YaClass selectYaClassById(Long id)
    {
        return yaClassMapper.selectYaClassById(id);
    }

    /**
     * 查询班级列表
     * 
     * @param yaClass 班级
     * @return 班级
     */
    @Override
    public List<YaClass> selectYaClassList(YaClass yaClass)
    {
        return yaClassMapper.selectYaClassList(yaClass);
    }

    /**
     * 新增班级
     * 
     * @param yaClass 班级
     * @return 结果
     */
    @Override
    public int insertYaClass(YaClass yaClass)
    {
        yaClass.setCreateTime(DateUtils.getNowDate());
        return yaClassMapper.insertYaClass(yaClass);
    }

    /**
     * 修改班级
     * 
     * @param yaClass 班级
     * @return 结果
     */
    @Override
    public int updateYaClass(YaClass yaClass)
    {
        yaClass.setUpdateTime(DateUtils.getNowDate());
        return yaClassMapper.updateYaClass(yaClass);
    }

    /**
     * 批量删除班级
     * 
     * @param ids 需要删除的班级主键
     * @return 结果
     */
    @Override
    public int deleteYaClassByIds(Long[] ids)
    {
        return yaClassMapper.deleteYaClassByIds(ids);
    }

    /**
     * 删除班级信息
     * 
     * @param id 班级主键
     * @return 结果
     */
    @Override
    public int deleteYaClassById(Long id)
    {
        return yaClassMapper.deleteYaClassById(id);
    }
}
